<?php

class Application_Model_Login{
  public static function logar($login, $senha){
    $db = Zend_Db_Table::getDefaultAdapter();
    $adapter = new Zend_Auth_Adapter_DbTable($db);
    $adapter->setTableName('usuarios');
    $adapter->setIdentityColumn('login');
    $adapter->setCredentialColumn('senha');
    $adapter->setIdentity($login);
    $adapter->setCredential($senha);
    $auth = Zend_Auth::getInstance();
    $result = $auth->authenticate($adapter);
    
    if($result->isValid()){
      return true;
    }else{
      return false;
    }
  }

}

